/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.transas.zornav.businesslogic;

/**
 *
 * @author amalikov
 */
public class Config {

	public Config() {
		airSpeed = 115;
		windSpeed = 0;
		windDir = 0;
		totalFuel = 32;
		fuelFlow = 5.5;
		departureTime = 0;
		fuelCalculated = false;
	}

	public double getAirSpeed() {
		return airSpeed;
	}

	public void setAirSpeed(double airSpeed) {
		if (this.airSpeed != airSpeed) {
			this.airSpeed = Math.max(airSpeed, 0.1);
			fuelCalculated = false;
		}
	}

	public double getWindSpeed() {
		return windSpeed;
	}

	public void setWindSpeed(double windSpeed) {
		if (this.windSpeed != windSpeed) {
			this.windSpeed = Math.max(windSpeed, 0);
			fuelCalculated = false;
		}
	}

	public double getWindDir() {
		return windDir;
	}

	public void setWindDir(double windDir) {
		if (this.windDir != windDir) {
			this.windDir = Math.min(Math.max(windDir, 0), 360);
			fuelCalculated = false;
		}
	}

	public double getTotalFuel() {
		return totalFuel;
	}

	public void setTotalFuel(double totalFuel) {
		this.totalFuel = Math.max(totalFuel, 0);
	}

	public double getFuelFlow() {
		return fuelFlow;
	}

	public void setFuelFlow(double fuelFlow) {
		if (this.fuelFlow != fuelFlow) {
			this.fuelFlow = Math.max(fuelFlow, 0);
			fuelCalculated = false;
		}
	}

	public double getDepartureTime() {
		return departureTime;
	}

	public void setDepartureTime(double departureTime) {
		this.departureTime = departureTime;
	}

	public boolean isFuelCalculated() {
		return fuelCalculated;
	}

	public void setFuelCalculated(boolean fuelCalculated) {
		this.fuelCalculated = fuelCalculated;
	}
	private double airSpeed;
	private double windSpeed;
	private double windDir;
	private double totalFuel;
	private double fuelFlow;
	private double departureTime;
	private boolean fuelCalculated;
	
}
